package com.haixiaoke.saas.house.service.impl;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.house.domain.HousePicture;
import com.haixiaoke.saas.house.mapper.HousePictureMapper;
import com.haixiaoke.saas.house.service.IHousePictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 房屋相册信息Service业务层处理
 *
 * @author xiaolong
 * @date 2024-10-22
 */
@Service
public class HousePictureServiceImpl implements IHousePictureService {
    @Autowired
    private HousePictureMapper housePictureMapper;

    /**
     * 查询房屋相册信息
     *
     * @param housePictureId 房屋相册信息主键
     * @return 房屋相册信息
     */
    @Override
    public HousePicture selectHousePictureByHousePictureId(Long housePictureId) {
        return housePictureMapper.selectHousePictureByHousePictureId(housePictureId);
    }

    /**
     * 查询房屋相册信息列表
     *
     * @param housePicture 房屋相册信息
     * @return 房屋相册信息
     */
    @Override
    public List<HousePicture> selectHousePictureList(HousePicture housePicture) {
        return housePictureMapper.selectHousePictureList(housePicture);
    }

    /**
     * 新增房屋相册信息
     *
     * @param housePicture 房屋相册信息
     * @return 结果
     */
    @Override
    public int insertHousePicture(HousePicture housePicture) {
        housePicture.setCreateTime(DateUtils.getNowDate());
        return housePictureMapper.insertHousePicture(housePicture);
    }

    /**
     * 修改房屋相册信息
     *
     * @param housePicture 房屋相册信息
     * @return 结果
     */
    @Override
    public int updateHousePicture(HousePicture housePicture) {
        housePicture.setUpdateTime(DateUtils.getNowDate());
        return housePictureMapper.updateHousePicture(housePicture);
    }

    /**
     * 批量删除房屋相册信息
     *
     * @param housePictureIds 需要删除的房屋相册信息主键
     * @return 结果
     */
    @Override
    public int deleteHousePictureByHousePictureIds(Long[] housePictureIds) {
        return housePictureMapper.deleteHousePictureByHousePictureIds(housePictureIds);
    }

    /**
     * 删除房屋相册信息信息
     *
     * @param housePictureId 房屋相册信息主键
     * @return 结果
     */
    @Override
    public int deleteHousePictureByHousePictureId(Long housePictureId) {
        return housePictureMapper.deleteHousePictureByHousePictureId(housePictureId);
    }

    @Override
    public int insertBatchHousePicture(List<HousePicture> housePictureList) {
        return housePictureMapper.insertBatchHousePicture(housePictureList);
    }

    @Override
    public HousePicture selectHousePictureByWorkOrderId(String workOrderId) {
        return housePictureMapper.selectHousePictureByWorkOrderId(workOrderId);
    }

    @Override
    public List<HousePicture> packagingHousePictureList(HousePicture housePicture) {
        return housePictureMapper.packagingHousePictureList(housePicture);
    }
}
